package com.smm.web.vmc.service;

import com.smm.web.vmc.domain.Alam;
import com.smm.web.vmc.domain.User;
import com.smm.web.vmc.dto.AlamQueryDto;
import com.smm.web.vmc.dto.ReceiptDto;
import com.smm.web.vmc.dto.UserDto;

import java.util.List;

/**
 * Created by zhenghao on 2016/8/26.
 *
 */
public interface UserService {

    //用户保存在session中的标识
    String USER_SESSION_KEY="_USER_SESSION_KEY";


    //登录
    User login(String account,String password) throws Exception;

    //注册
    User regist(UserDto user) throws Exception;

    //获取所有仓单列表
    List<ReceiptDto> getAllReceiptByUser(int userId);

    //获取所有仓单报警记录列表
    List<Alam> getAllAlamByUser(int userId);

    //查询报警记录
    List<Alam> queryAlam(int userId,AlamQueryDto query);


    //修改密码
    void updatePassword(int userId,String newPassword) throws Exception;

    //获取用户dto 对象
    List<UserDto> getAllForDto();

    User getOneById(int userId);

    /**
     * 为用户分配仓单
     * @param
     * @throws Exception
     */
    void choiseReceipt(int userId,List<String> repNoList) throws Exception;


    void update(User user) throws Exception;

    /**
     * 检查指定会员是否有访问指定摄像头的权限
     * @param userId
     * @param cameraId
     * @return*/

    boolean checkPurviewForCamera(int userId, int cameraId);


    /**
     * 修改用户手机号码
     * @param userId
     * @param phone
     * @throws Exception
     */
    void updateUserPhone(int userId,String phone) throws Exception;
}
